<%--
  Created by IntelliJ IDEA.
  User: User
  Date: 2020/6/1
  Time: 21:07
  To change this template use File | Settings | File Templates.
--%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>订单详情</title>
</head>
<jsp:useBean id="db" class='hello.DB'></jsp:useBean>
<body style="background:url(page/interface.jpg)">
<h1 align="center">我的订单</h1>
<br><br>
<%@ page import="java.sql.*" %>
订单<%out.print(request.getParameter("ordernum")); %>成功退票
<%
    db.init();
    String s="select * from orders where ordernum='"+request.getParameter("ordernum")+"'";
    ResultSet rs=db.executeQuery(s);
    rs.next();
    String passenger =rs.getString("passenger");
    String trainnum=rs.getString("trainnum");
    String begin=rs.getString("Originating");
    String end=rs.getString("arriving");
    String seattype=rs.getString("seattype");
    String time=rs.getString("time");
    //座位增加
    String sql="exec seat_opearing '"+trainnum
            +"','"+begin
            +"','"+end+"','"+seattype
            +"','"+time+"','-'";
    db.executeQuery(sql);
    //乘客减少  触发器实现
    sql="exec order_update '"+request.getParameter("ordernum")+"'";
    //订单信息修改
    sql="update orders set status='已退票'  where ordernum='"+request.getParameter("ordernum")+"'";
    db.executeQuery(sql);
    db.close();
%>
</body>
</html>
